<template>
    <a-locale-provider :locale="locale">

    <div id="app">

        <router-view/>
    </div>
    </a-locale-provider>

</template>

<style lang="less">
    #app {
        /*width:1920px;*/
        /*height: 1080px;*/
        font-family: Avenir, Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        color: #2c3e50;

    }
</style>

<script>

    // import {getLocalLoginInfor} from "./utils/storage-utils";
    import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
    import {login} from "@/common/api";
    export default {
        data(){return {
            locale: zhCN,

        }},
        computed:{
            isLogin() {
                return this.$store.getters.isLogin
            }
        },
        methods:{
          setWW(){
              const ws = {
                      ww:0,
                      wh:0,
              };
              ws.ww = window.innerWidth;
              ws.wh = window.innerHeight;
              this.$store.commit("resizeWindow",ws)
          }
        },
        beforeMount(){
            console.log("app beforeMount")
            this.setWW();
            //window width 0-xs 1-sm 2-md 3-lg 4-xl
            window.addEventListener("resize", () => {
                this.setWW()
            });
            // 项目加载获取本地token，放入store
            //TODO 没有登录跳转到登录页面
            // this.$store.commit("setLoginInfor",getLocalLoginInfor());
            // if(!this.isLogin){
            //         this.$router.push("/login")
            // }else{
            // }
            document.getElementById("pageLoading").style.display="none";
        },



    }

</script>
